<include file="Goods:leftmenu" />
<style>
.green{
	color:#25c401;
	font-size:16px;
}
.red{
	color:#e1321c;
}
.gray{
	color:#a0a0a0;
}
</style>
<div class="content-right fl">


	<h1 class="content-right-title">
	</h1>


	<!-- <a href="/admin/add" class="btn btn-success">发布商品</a>-->

	<form action="" method="get">
		<div class="tables-searchbox newcearchbox">
		

			<select name="gtype_id" class="select small newselect">
				<option value="" selected="">所有分类</option>
				<?php foreach($gtype as $k=>$v){ ?>
				<option value="<?php echo $v['gtype_id'];?>"  <?php echo $v['gtype_id']==get('gtype_id')?"selected":"";?>><?php echo $v['gtype_name'];?></option>
				<?php } ?>
			</select>

			
			<input type="text" placeholder="输入商品名称" class="input" name="goods_name" value="<?php echo get('goods_name');?>">
			<button class="btn btn-primary" style="line-height: 26px;">
				<i class="gicon-search white"></i>查询
			</button>
			<a href="/admin/goods/index" class="btn btn-primary vtal-2">清除查询</a>
		</div>
		<div class="tabs clearfix mgt10">
			<a href="/admin/goods/index" class="<?php echo ($action=="index")?"active":'';?> tabs_a fl">全部(<?php echo $goods_count[0];?>)</a>
			<a href="/admin/goods/onsale" class="<?php echo ($action=="onsale")?"active":'';?> tabs_a fl">出售中(<?php echo $goods_count[1];?>)</a>
			<a href="/admin/goods/onsku" class=" <?php echo ($action=="onsku")?"active":'';?> tabs_a fl">仓库中(<?php echo $goods_count[3];?>)</a>
			<a href="/admin/goods/outstock" class="<?php echo ($action=="outstock")?"active":'';?> tabs_a fl">已售罄(<?php echo $goods_count[2];?>)</a>
		</div>
	</form>
	<!-- end tabs -->

	<table class="wxtables mgt10">
		<colgroup>
			<col width="5%">
			<col width="7%">
			<col width="10%">
			<col width="10%">
			<col width="10%">
			<col width="10%">
			<col width="10%">
			<col width="10%">
			<col width="10%">
			<col width="5%">
			<col width="10%">
		</colgroup>
		<thead>
			<tr class="po_list">
				<!--  <td><i class="icon_check"></i></td>-->
				<td>商品编号<span></span></td>
				<td>图片<span></span></td>
				<td>商品名称<span></span></td>
				<td>商品分类<span></span></td>
				<td>零售价<span></span></td>
				<td>供货价<span></span></td>
				<td>供货商姓名<span></span></td>
				<td>供货商用户编号<span></span></td>
				<td>库存<span></span></td>
				<td>状态<span></span></td>
				<td>操作<span></span></td>
			</tr>
		</thead>
		<tbody>
		
<?php foreach($datalist as $k=>$v){?>
		
			<tr>
				<td><?php echo $v['goods_id'];?></td>
				<td><img src="<?php echo C("UPYUN_DOMAIN").$v['goods_pic'];?>!headimgurl"  width="60" height="60"  onerror="javascript:this.src='__STATIC__/admin/images/error.png';">
				</td>
				<td><a href="javascript:chakan(<?php echo $v['goods_id'];?>);" class="block" target="_blank">
				<div class="table-item-info" style="width: 210px;">
				<p><?php echo $v['goods_name'];?></p>
				</div>
				</a>
				</td>
				<td><?php echo ($v['gtype_id']) ? ($gtype[$v['gtype_id']]['gtype_name'] ? $gtype[$v['gtype_id']]['gtype_name'] : '未分类') : "未分类";?></td>
				<td><?php echo $v['shop_price'];?></td>
				<td><?php echo $v['gonghuo_price'];?></td>
				<td><?php echo $v['gonghuo_realname'];?></td>
				<td><?php echo $v['gonghuo_uid'];?></td>
				<td><?php echo $v['stock'];?></td>
				<td><?php echo $v['ischeck'] ? "<span class='green'>售</span>":"<span class='red'>已下架</span>";?></td>
				<td>
			<a href="/admin/goods/supplieredit/?goods_id=<?php echo $v['goods_id'];?>" class="btn width btn-primary btn-small" title="修改">编辑</a>
				</td>
			</tr>
			
<?php } ?>

		</tbody>

	</table>
	<div class="tables-btmctrl clearfix">
           <div class="mgt10">
               <div class="paginate">
                  {$page}
               </div>
           </div>
	</div>
</div>

